home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / CHARMNET.CMD < prev    next >
Encoding:
Text File  |  1996-02-27  |  1.8 KB  |  112 lines

  1. #    Login.cmd for Charm Net
  2. #
  3. #trace on
  4. #
  5. # set up some strings for dialling up
  6. #
  7. if ![load $number]
  8.   if [query $number "Enter your dial up phone number"]
  9.     save $number
  10.   end
  11. end
  12. if ![load $username]
  13.   if [username "Enter your login username"]
  14.     save $username
  15.   end
  16. end
  17. if ![load $password]
  18.   if [password "Enter your login password"]
  19.     save $password
  20.   end
  21. end
  22. $modemsetup = "z"
  23. $prompt = "PPP"
  24. $userprompt = "ogin:"
  25. $passprompt = "assword:"
  26. $slipcmd = "slip"
  27. $addrtarg = "Your address is"
  28. $pppcmd = "ppp"
  29. $stpr = "~"
  30. %attempts = 10
  31. #
  32. #
  33. #----------------------------------------------------------
  34. #
  35. # initialize modem
  36. #
  37. output "atz"\13
  38. if ! [input 10 OK\n]
  39.   display "Modem is not responding"\n
  40.   abort
  41. end
  42. #
  43. # setup our modem commands
  44. #
  45. output "at"$modemsetup\13
  46. input 10 OK\n
  47. #
  48. # send phone number
  49. #
  50. %n = 0
  51. repeat
  52.   if %n = %attempts
  53.     display "Too many dial attempts"\n
  54.     abort
  55.   end
  56.   output "atdt"$number\13
  57.   %ok = [input 60 CONNECT]
  58.   %n = %n + 1
  59. until %ok
  60. input 10 \n
  61. #
  62. #  wait till it's safe to send because some modem's hang up
  63. #  if you transmit during the connection phase
  64. #
  65. wait 30 dcd
  66. #
  67. # now prod the terminal server
  68. #
  69. output \13
  70. #
  71. #  wait for the username prompt
  72. #
  73. input 30 $userprompt
  74. output P$username\13
  75. #
  76. # and the password
  77. #
  78. input 30 $passprompt
  79. output $password\13
  80. #
  81. # we are now logged in
  82. #
  83. input 30 $prompt
  84. if %ppp
  85.   #
  86.   # jump into ppp mode
  87.   #
  88.   #
  89.   input 30 $stpr
  90.   #
  91.   display "PPP mode selected.  Will try to negotiate IP address."\n
  92.   #
  93. else
  94.   #
  95.   # jump into slip mode
  96.   #
  97.   #
  98.   # wait for the address string
  99.   #
  100.   #
  101.   # parse address
  102.   #
  103.   #
  104.   # we are now connected, logged in and in slip mode.
  105.   #
  106.   display \n
  107.   display Connected.  Your IP address is \i.\n
  108. end
  109. #
  110. # now we are finished.
  111. #
  112.